<?php
/**
 * PrynLib
 * @copyright 2007-2009 Prynel
 * @author Olivier ROGER <roger.olivier@gmail.com>
 * @category libPrynel
 * @package PDF
 * @version $Revision: 80 $
 */

/**
 *
 * @category libPrynel
 * @package PDF
 * @link http://www.fpdf.org
 * @version 1.0.0 
 * @author Olivier ROGER <roger.olivier@gmail.com>
 * @copyright  2007-2009 Prynel
 *       
 *
 */
class PDF_PrynPDF extends PDF_FPDF
{
     public $mois;
     public $annee;
	 function Header()
	 {
	 	$this->Image('../../../struct/images/prynel.jpg',10,null,40);
		//Police Arial gras 15
	    $this->SetFont('Arial','B',16);
	    //Décalage à droite
	    $this->Cell(80);
	    //Titre
	    $this->Cell(40,10,'Bilan mensuel du '.$this->mois.'/'.$this->annee,0,0,'C');
	    //Saut de ligne
	    $this->Ln(20);
	 }
	 
	 function Footer()
	 {
	 	//Positionnement à 1,5 cm du bas
	    $this->SetY(-15);
	    //Police Arial italique 8
	    $this->SetFont('Arial','I',8);
	    //Numéro de page
	    $this->Cell(0,10,'Page '.$this->PageNo().'/{nb}',0,0,'C');
	 	
	 }
	 function LoadData($file,$part)
	{
	    //Lecture des lignes du fichier
	    $lines=file($file);
	    $data=array();
	    foreach($lines as $line)
	        $data[]=explode(';',rtrim($line));

	    return $data;
	}
	 
	function BasicTable($header,$data)
	{
	    //En-tête
	    $this->SetFont('','B');
	    $this->SetFillColor(0,121,192);
	    $this->SetTextColor(255);
	    foreach($header as $col)
	        $this->Cell(30,7,$col,1,0,'C',1);
	    $this->Ln();
	    //Données
	    $this->SetFont('');
	    $this->SetFillColor(224,235,255);
	    $this->SetTextColor(0);
	    $modulo=0;
	    foreach($data as $row)
	    {
	        foreach($row as $col)
	        {
	            if($modulo%2==0)
	            	$this->Cell(30,6,$col,1,0,'C',0);
	            else
	        		$this->Cell(30,6,$col,1,0,'C',1);
	            
	        }
	        $modulo++;
	        $this->Ln();
	    }
	}
	
}
 ?>